<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<%@include file="../../../../include/meta.jsp"%>
<title>添加功能模块-通用权限管理系统</title>
<%@include file="../../../../include/css.jsp"%>
<style type="text/css">
.form-group button {
	margin-bottom: 5px;
}
</style>
</head>
<body>
	<%@include file="../../include/header.jsp"%>

	<nav aria-label="breadcrumb">
		<ol class="breadcrumb">
			<li class="breadcrumb-item"><a
				href="${pageContext.request.contextPath}/app/main.html"><i
					class="fas fa-home"></i>&nbsp;主页</a></li>
			<li class="breadcrumb-item"><a
				href="${pageContext.request.contextPath}/app/function/list.html">功能组管理</a></li>
			<li class="breadcrumb-item active" aria-current="page">添加功能模块</li>
		</ol>
	</nav>

	<div class="container">
		<div class="row">
			<div class="col-12">
				<form
					action="${pageContext.request.contextPath}/app/function/module/save.html"
					method="post">
					<div class="form-group">
						<label for="name">所属功能组</label> <select class="form-control"
							name="parent" aria-describedby="hpParent">
							<option value="">请选择功能组...</option>
							<c:forEach items="${fgList}" var="fg">
								<option value="${fg.id}">${fg.name}</option>
							</c:forEach>
						</select> <small id="hpParent" class="form-text text-danger">${msgParent}</small>
					</div>
					<div class="form-group">
						<label for="name">功能模块名</label> <input type="text"
							class="form-control" name="name" value="${fm.name}"
							aria-describedby="helpName" autofocus required> <small
							id="helpName" class="form-text text-danger">${msgName}</small>
					</div>
					<div class="form-group">
						<label for="name">功能模块代码</label> <input type="text"
							class="form-control" name="code" required value="${fm.code}"
							aria-describedby="hpCode"> <small id="hpCode"
							class="form-text text-danger">${msgCode}</small>
					</div>
					<div class="form-group row">
						<div class="col-md-4">
							<button type="submit" class="btn btn-primary btn-block">保存</button>
						</div>
						<div class="col-md-3">
							<button type="reset" class="btn btn-dark btn-block">重置</button>
						</div>
						<div class="col-md-2 offset-1">
							<a class="btn btn-secondary btn-block"
								href="${pageContext.request.contextPath}/app/function/list.html">返回列表页</a>
						</div>
						<div class="col-md-2">
							<a class="btn btn-secondary btn-block"
								href="${pageContext.request.contextPath}/app/main.html">返回主页</a>
						</div>
					</div>
				</form>
				<div id="message" class="text-danger">
					${message}
					<script type="text/javascript">
					setTimeout(function(){
						$("#message").text("");
					},3000);
				</script>
				</div>
			</div>
		</div>
	</div>

	<%@include file="../../../../include/js.jsp"%>
</body>
</html>